import React, { Component } from 'react'
import { Table } from 'antd';

export default class BottomTable extends Component {

  // Table配置
  columns = [
    { title: '序号', dataIndex: 'INDEX', width: 65, align: 'center', render: (t, r, index) => { return index + 1 } },
    { title: '工程类型', dataIndex: 'projectType', align: 'center', width: 100 },
    { title: '工程分类', dataIndex: 'projectClassify', align: 'center', width: 100 },
    { title: '工程编号', dataIndex: 'businessid', width: 120, align: 'center' },
    { title: '项目名称', dataIndex: 'entryname', align: 'center' },
    { title: '工程名称', dataIndex: 'projectname', align: 'center' },
    { title: '金额', dataIndex: 'contractamount', width: 110, align: 'center' },
    { title: '施工单位', dataIndex: 'constructionunit', align: 'center' },
    { title: '开工日期', dataIndex: 'commencementdate', width: 110, align: 'center' },
    { title: '结项日期', dataIndex: 'postprojectdate', width: 110, align: 'center' },
    { title: '工程状态', dataIndex: 'statename', width: 120, align: 'center' },
  ];

  // 生成Table表格
  getTable = (item) => {
    item.forEach((x, i) => { x.key = i });
    return (
      <Table columns={this.columns} dataSource={item} pagination={false} scroll={{ y: 300 }} size="small" bordered />
    )
  }


  render() {
    return (
      <>
        {this.getTable(this.props.tableModule)}
      </>
    )
  }
}
